/*
 * @Author: yanjikun
 * @Date: 2022-06-13 10:53:14
 * @LastEditors: yanjikun
 * @LastEditTime: 2022-06-14 10:01:10
 * @Description: file content
 */

import { MockMethod } from 'vite-plugin-mock'

export default [
  {
    url: '/api/v1/authenticate',
    method: 'post',
    response: ({ body }) => {
      const { login, password } = body
      if (login === 'admin' && password === '123456') {
        return {
          code: 1,
          msg: '成功',
          data: {
            id: 3,
            org: 3,
            orgName: '',
            category: 3,
            login: 'admin',
            username: 'Admin',
            status: 1,
            insertBy: 'admin',
            insertAt: '2018-10-17 09:53:49',
            phone: '',
            msgPush: false,
            token:
              'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImF1dGgiOiJST0xFX1VTRVIsUk9MRV9BRE1JTiIsImV4cCI6MTgyNzg5OTIzN30.pbf2GakzeBm4GGtMvawsPXWdB0Z0XWdV-XMXWK3luRaSQR6uFPWgGXyeopEVaAGw-b0sHNGj79Tbc2KuTYDx0g',
          },
        }
      }
      return { code: -1, msg: '登录名或密码错误', data: false }
    },
  },
] as MockMethod[]
